<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.3.1.min.js"></script>
</head>

<body>
    <form action="login" method="post">
        账号: <input type="text" name="username"/><br/> 密码：
        <input type="password" name="password"/><br/>
        验证码：<input type="text" name="imgcode"/><img src="/user/getImageCode" id="codeImg"/><br/>
        <input type="submit" value="登录">
    </form>
</body>

</html>

<script type="text/javascript">
    $(function(){
        $("#codeImg").on("click",function(){
            $(this).attr("src","/user/getImageCode?random=' + Math.random()).fadeIn()+'");
        });
    });
</script>
